<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<div id="Content">
    <form id="excelValid" method="post" action="/Do/SZOperation/ImportAction" enctype="multipart/form-data">
        <input type="hidden" name="pid" value="${pid}"/>
        <input type="hidden" name="fid" value="${fid}"/>
        <input type="hidden" name="deptcode" value="${deptcode}"/>
        <div class="help">
            <b>注意：</b><br>
            1、您必须先导出实作安排，修改其中的实作内容和成绩，再使用本功能导入。导入成绩将覆盖已有的成绩。<br>
            2、只有发送短信通知以后才能导入实作成绩。<br>
            3、数据导入请上传excel格式(<b>后缀为：xls</b>)文件。如果文件数据太大，请拆分为多个文件进行多次导入。
        </div>
        <table class="treeTable searchform">
            <thead>
            <tr>
                <td width="80">Excel文件：</td>
                <td>
                    <div><input type="file" name="excel" datatype="*" nullmsg="请选择Excel文件"/></div>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <button type="submit" class="op">导入实作成绩</button>
                </td>
            </tr>
            </thead>
        </table>
    </form>
</div>
<script src="/resources/js/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#excelValid").Validform({
            ajaxPost: true,
            beforeSubmit: function (curform) {
                curform.ajaxSubmit({
                    type: 'post',
                    success: function (data) {
                        if (data.state) {
                            parent.$.Showmsg(data.Message);
                            parent.getList();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        }
                        else {
                            $.Showmsg(data.Message);
                        }
                    }
                });
                return false;
            }
        });
    });
</script>
</body>
</html>